//
//  VSTableViewCell.m
//  Project_A
//
//  Created by dlios on 15/7/23.
//  Copyright (c) 2015年 zhoukaidong. All rights reserved.
//

#import "VSTableViewCell.h"
#import "VSFrameGrand.h"
@implementation VSTableViewCell

- (void)dealloc
{
    [_VSImageView release];
    [_VSRightLabel release];
    [_VSTextLabel release];
    [_memory release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.VSTextLabel = [[[UILabel alloc]init] autorelease];
        [self.contentView addSubview:self.VSTextLabel];
        self.pathLabel = [[[UILabel alloc]init] autorelease];
        self.AAimage = [[[UIImageView alloc]init] autorelease];
        self.myswitch = [[[UISwitch alloc] init] autorelease];
        self.versionLabel = [[[UILabel alloc]init] autorelease];
    }
    return self;
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.VSTextLabel.frame = CGRectMake(20, 10, 120, 30);
    
    NSMutableArray *TextArr = [@[@"版本更新",@"夜间模式",@"清除缓存",@"清空收藏",@"关于我们",@"意见反馈",@"给我们评分"]mutableCopy];
    NSMutableArray *Arr = [NSMutableArray array];
    [Arr addObject:self.memory];
    if (self.section == 0) {
        self.VSTextLabel.text = TextArr[self.row];
        self.versionLabel.frame = CGRectMake(100, 10, 80, 30);
        self.versionLabel.backgroundColor = [UIColor clearColor];
        self.versionLabel.text = @"1.0.4";
        self.versionLabel.alpha = 0.5;
        [self.contentView addSubview:self.versionLabel];
    }  else if (self.section == 1) {
        if (self.row == 0) {
            self.myswitch.frame = CGRectMake(SCREEN_WIDTH - 66, 10, 60, 30);
            self.myswitch.on = YES;
            [self.myswitch setOn:YES animated:YES];
            [self.contentView addSubview:self.myswitch];
        }  else if (self.row == 1) {
            self.pathLabel.frame = CGRectMake(SCREEN_WIDTH - 66, 10, 60, 30);
            self.pathLabel.backgroundColor = [UIColor clearColor];
            [self.contentView addSubview:self.pathLabel];
            self.pathLabel.text = Arr[0];
            self.pathLabel.alpha = 0.5;
        }
        self.VSTextLabel.text = TextArr[self.row + 1];
    }  else if (self.section == 2 ) {
        self.VSTextLabel.text = TextArr[self.row + 4];
        if (self.row != 2) {
            self.AAimage.image = [UIImage imageNamed:@"VSRightImage.png"];
            self.AAimage.frame = CGRectMake(SCREEN_WIDTH - 44, 13, 24, 24);
            [self.contentView addSubview:self.AAimage];
        }
        
    }
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
